<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
	<head>
	<title>publish</title>
	</head>
<script type="text/javascript" src="../js/prototype.js"></script>
<script type="text/javascript" src="../js/common.js"></script>
<script type="text/javascript" src="../ckeditor/ckeditor.js"></script>
<script type="text/javascript">
function ufogetValue(){
	var val = CKEDITOR.instances.editor1.getData();//这里的editor1是下面textarea的id
	//参考网址
	//JS获取CkEditor在线编辑的内容
		//http://www.cnblogs.com/wuqihui/archive/2012/08/18/2645116.html
	//CKEDITOR使用与配置
		//http://www.cnblogs.com/Fskjb/archive/2009/11/16/1603461.html
	if (val.length == 0){
		alert("空白");
	}else{
		alert(val);
	}
}

function openxls()
{
	var divz=document.getElementById('xlsbox');
	var ctnz=document.getElementById('content');
	divz.style.zIndex=1;
	ctnz.style.height="1000px";
	}
	
function openbtn()
{
	var codez=document.getElementById('codeiv');
	codez.style.zIndex=1;
	}
function over()
{
	var divz=document.getElementById('xlsbox');
	var ctnz=document.getElementById('content');
	divz.style.zIndex=-1;
	ctnz.style.height="800px";
	alert("表格已生成")
}
function over2()
{
	alert("验证码已生成，请发布活动后到已发布活动中查看")
}
function pubbtn()
{
	//var pubtxt= document.getElementById('editor1').value;
	var pubtxt = CKEDITOR.instances.editor1.getData();
	var pubname=document.getElementById('exename').value;
	var checky=document.getElementById('year').value;
	var checkm=document.getElementById('month').value;
	var checkd=document.getElementById('day').value;
	var cdata=checky+"-"+checkm+"-"+checkd+" "+"00:00:00";
	var sdata=CurentTime();
	var useid=getCookie("userId");
	var url = '../json/addAction';
	var params = "description="+pubtxt+"&title="+pubname+"&startDate="+sdata+"&checkDate="+cdata+"&endDate=2017-12-31 00:00:00&score="+10;
	alert(params);
	var myAjax = new Ajax.Request(
	url,
	{
		method:'post',
		parameters:params,
		onComplete: processResponse3,
		asynchronous:true
	});
	}
function processResponse3(request)
{
	var res = request.responseText.evalJSON();
	if(res['result']['flag']=="true")
		alert('请到已发布活动中察看！');
}
</script>
<link href="../css/FrameCss.css" type="text/css" rel="stylesheet">

<body onload="online()">
    <center>
<div id="contain">
  <div id="banner">
  <img src="../source/titlenew.png" width="1024" height="158">
  </div>


  <div id="content" style="height:800px;">
       <div id="leader">

            <ul>
            <li>
                 <a href="#"  id="leadercolor" >用户管理</a> 
                     <ul>
                          <li><a href="#" id="leadercolor">修改密码</a> </li>
                          <li><a href="#" id="leadercolor">注销</a> </li>
                          <li><a href="#" id="leadercolor">退出</a> </li>
                    </ul>
            </li>
            <li>
                <a href="#"  id="leadercolor" >系统帮助</a> 
                    <ul>
                        <li><a href="#" id="leadercolor">使用说明</a></li> 
                        <li><a href="#" id="leadercolor">联系管理员</a></li>
                   </ul> 
            </li>
        </ul>
         <div id="demo">welcome</div>
       </div>
  
       <div id="back"><a href="TeacherMain.html"><img src="../source/blackback.png" width="70" height="70"></a>
       </div>
       <div id="pub">
        <p>活动名称:&nbsp;&nbsp;<input id="exename" name="exename" type="text" style="width:193px;" /></p>
        <p>信息提交截止日期:
         <select id="year" name="year">
            <option value="2013">2013</option>
            <option value="2014">2014</option>
            <option value="2015">2015</option>
            <option value="2016">2016</option>
         </select>
         年
           <select id="month" name="month">
            <option value="1">1</option>
            <option value="2">2</option>
            <option value="3">3</option>
            <option value="4">4</option>
            <option value="5">5</option>
            <option value="6">6</option>
            <option value="7">7</option>
            <option value="8">8</option>
            <option value="9">9</option>
            <option value="10">10</option>
            <option value="11">11</option>
            <option value="12">12</option>
          </select>
          月
          <select name="day" id="day">
            <option value="1">1</option>
            <option value="2">2</option>
            <option value="3">3</option>
            <option value="4">4</option>
            <option value="5">5</option>
            <option value="6">6</option>
            <option value="7">7</option>
            <option value="8">8</option>
            <option value="9">9</option>
            <option value="10">10</option>
            <option value="11">11</option>
            <option value="12">12</option>
            <option value="13">13</option>
            <option value="14">14</option>
            <option value="15">15</option>
            <option value="16">16</option>
            <option value="17">17</option>
            <option value="18">18</option>
            <option value="19">19</option>
            <option value="20">20</option>
            <option value="21">21</option>
            <option value="22">22</option>
            <option value="23">23</option>
            <option value="24">24</option>
            <option value="25">25</option>
            <option value="26">26</option>
            <option value="27">27</option>
            <option value="28">28</option>
            <option value="29">29</option>
            <option value="30">30</option>
            <option value="31">31</option>
          </select>日         
          <label for="day"></label>

          </p>
      

          <p>生成参与验证码:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
             <input type="radio" name="RadioGroup1" value="1" id="RadioGroup1_0" onclick="openbtn()" />&nbsp;
                  是&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
             <input type="radio" name="RadioGroup1" value="2" id="RadioGroup1_1" />&nbsp;
                  否
          </p>

          <p>加入表格:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
              <input type="radio" name="RadioGroup2" value="1" id="RadioGroup2_0" onclick="openxls()"/>
                 是 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
             <input type="radio" name="RadioGroup2" value="2" id="RadioGroup2_1" />
                 &nbsp; 否
           </p> 
 

          </div>
          <div id="xlsbox">  
          
  
            <div id="xlsright">
    
              <form style="height:780px;">
	         	<p>
			       
			     <textarea cols="80" id="editor1" name="editor1" rows="10"></textarea>
		       </p>
		       <p>
		      	<input type="button" value="完成" onclick="over()"/>
		       </p>
	         </form>
	         <script type="text/javascript">CKEDITOR.replace('editor1');</script>
            </div>  
         </div>
         <div id="codeiv" style="position:absolute; z-index:-1; top:135px; right:40px;font-family:'微软雅黑'; font-size:24px; text-align:left">
            <p style="font-family:'微软雅黑'; font-size:24px; text-align:left;">请输入验证码数量：<br><br><input name="codetxt" type="text" /></p>
            <p><input name="probtn" type="button" value="生成" onclick="over2()" style="background-color:#F93; height:30px; width:70px"/></p>
         </div>
   
    
        <div style="position:absolute; bottom:40px; left:450px;"><input name="btnok" type="button" value="发布活动" onclick="pubbtn()" style="background-color:#F93; height:50px; width:90px"/> 
        </div>

  </div>
  <div id="footer">
           <ft1 id="onp">当前在线人数：</ft1>
           <ft2>经济管理学院</ft2></br>
           <ft3>© E M</ft3>
  </div>
</div>
</center>
	</body>
</html>
